import { Injectable } from "@nestjs/common";
import { UserRolesDto } from "../dto/user-roles.dto";
import { Role } from "../entities/role.entity";


@Injectable()
export class RoleRespository {

    async getUserRoles(userId: number) {
        const res: UserRolesDto[] = await Role.query("select role.roleName from role, user_role ur where role.id = ur.roleId and ur.userId=? and ur.status=1", [userId]);
        return res;
    }

}